package com.springboot.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.springboot.po.Coupon;
import com.springboot.service.CouponService;

@RestController
@RequestMapping("/CouponController")
public class CouponController {
	@Autowired
	CouponService couponService;
	
	@RequestMapping("/getCoupon")
	public Coupon getCoupon(Integer typeId) {
		//获取typeId对应的优惠券
		return couponService.getCoupon(typeId);
	}
	
	@RequestMapping("/listCoupon")
	public List<Coupon> listCoupon(){
		return couponService.listCoupon();
	}

}
